<template>
    <div class="appTable">
        <div class="table">
            <div class="mask"></div>
            <div class="table_title">{{ table_title }}管理</div>
            <div class="table_btns" v-if="operate && showAdd">
                <el-button @click="handleAdd" style="margin-right: 4%" type="primary" icon="el-icon-folder-add">添加</el-button>
            </div>
            <div class="table_body">
                <zy-table :loading="loading" :tableData="tableData" :tableColumn="tableColumn" :pageSize="pagination.pageSize" :total="pagination.total" @changePage="changePage"></zy-table>
            </div>
        </div>
        <el-dialog class="elDialog" title="" :visible.sync="isShow1" width="70%">
            <div style="width: 100%; height: 60vh">
                <zy-table :tableData="tableData1" :tableColumn="tableColumn1"></zy-table>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import { column, column1 } from './formConfig.js'
import BasicManage from '@/components/basic/BasicManage.vue'

export default {
    extends: BasicManage,
    data() {
        return {
            table_title: '告警推送',
            queryForm: {
                page: 1,
                size: 20,
            },
            queryFormC: {
                page: 1,
                size: 20,
            },
            url: 'message',
            tableData1: {},
            tableColumn1: [],
            isShow1: false,
        }
    },
    computed: {},
    methods: {},
    created() {
        this.getlist()
        column[column.length - 1].buttons = [
            {
                text: '推送列表',
                click: (val) => {
                    this.tableData1 = JSON.parse(val.list)
                    this.isShow1 = true
                },
                icon: 'el-icon-s-comment',
            },
            {
                text: '删除',
                click: (val) => this.delete(val),
                icon: 'el-icon-delete',
            },
        ]
        column[column.length - 1].if = this.operate
        this.tableColumn = column
        this.tableColumn1 = column1
    },
}
</script>
<style lang="less" scoped>
::v-deep {
    .el-dialog__header {
        display: none;
    }
    .el-dialog__body {
        padding: 0;
        border-radius: 5px;
    }
}

@import url(@/assets/css/table.less);
.table_title {
    font-size: 20px;
    color: #00ddff;
    font-weight: 600;
    height: 40px;
    line-height: 40px;
    display: flex;
    justify-content: space-between;
    background-image: url(@/assets/common/form_item_bg.png);
    background-size: 100% 100%;
    padding: 0 20px;
}
.el-button {
    width: 80px;
    margin-left: 20px;
    height: 40px;
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    display: flex;
    justify-content: center !important;
}
.table_btns {
    flex: 1;
    display: flex;
    justify-content: right;
}
</style>
